package com.atguigu.inherited;

public class Person extends Father{//父类
    //这里故意先不私有化
    public String name;
    public int age;
    //私有化
    private char gender;//性别

    //构造器
    //无参构造
    public Person() {
    }

    //有参构造
    public Person(String name, int age, char gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public void eat(){
        System.out.println("吃东西");
    }

    public String getInfo(){
        return "姓名：" + name +"，年龄：" + age;
    }
}
